import request from '@/utils/request'

export const ArticleTypeApi = {

    /**
     *  分页
     * @returns
     */
    getPage: (data) => {
        return request({
            url: '/manage/cms/articleType/getPage',
            data,
            method: 'post'
        })
    },

    /**
     *  获取所有类型
     * @returns
     */
    getAllList: () => {
        return request({
            url: '/manage/cms/articleType/getAllList',
            method: 'get'
        })
    },

    /**
     *  删除
     * @returns
     */
    delete: (typeId) => {
        return request({
            url: '/manage/cms/articleType/delete',
            params: {typeId},
            method: 'get'
        })
    },

    /**
     *  更新
     * @returns
     */
    edit: (data) => {
        return request({
            url: '/manage/cms/articleType/edit',
            data,
            method: 'post'
        })
    },

    /**
     *  插入
     * @returns
     */
    add: (data) => {
        return request({
            url: '/manage/cms/articleType/add',
            data,
            method: 'post'
        })
    },

    /**
     *  修改排序
     * @returns
     */
    updateSort: (data) => {
        return request({
            url: '/manage/cms/articleType/updateSort',
            data,
            method: 'post'
        })
    },

    /**
     *  修改状态
     * @returns
     */
    updateStatus: (data) => {
        return request({
            url: '/manage/cms/articleType/updateStatus',
            data,
            method: 'post'
        })
    },
    /**
     *  查询子类
     * @returns
     */
    getListByParentId: (parentId) => {
        return request({
            url: '/manage/cms/articleType/getListByParentId',
            params: {parentId},
            method: 'get'
        })
    },

}
